# -*- coding: utf-8 -*-
# from selenium import webdriver
# import time
# import random
# # https://weibo.com
# # https://s.weibo.com/top/summary
#
#
# class WeiBo(object):
#
#     options = webdriver.ChromeOptions()
#     # # 无界面参数
#     # options.add_argument('--headless')
#
#     wbc = webdriver.Chrome(options=options)
#     # wbc.get('https://s.weibo.com/top/summary')
#     # time.sleep(random.randint(2, 3))
#     #
#     # # 执行js脚本，获取动态加载数据
#     # wbc.execute_script(
#     #     # 把进度条拉到最下面
#     #     'window.scrollTo(0,document.body.scrollHeight)'
#     # )
#     #
#     # html_trs = wbc.find_elements_by_xpath('//div[@class="data"]/table/tbody/tr')
#     # t_list = []
#     # for tr in html_trs:
#     #     title = tr.find_element_by_xpath('./td[@class="td-02"]/a').text
#     #     link = tr.find_element_by_xpath('./td[@class="td-02"]/a').get_attribute('href')
#     #     t_list.append((title, link))
#     # print(t_list)
#
#     wbc.get('https://weibo.com')
#     time.sleep(5)
#     left_items = wbc.find_elements_by_xpath('//div[@class="UG_left_nav"]/ul/div')
#     left_items[3].click()






